/**
 * Created by hxpeng on 2017/4/18.
 */
(function () {
    'use strict';

    angular.module('App.pages.dynamic')
        .controller('DynamicInfoCtrl', DynamicInfoCtrl);

    function DynamicInfoCtrl($scope,DynamicModel,$stateParams,AppUtils) {

        var vm = this;
        vm.dynamic = {};
        vm.dynamicId = "";
        $scope.$on('$ionicView.enter', function(){
            vm.dynamicId = _.clone($stateParams.dynamicId);
            if(!AppUtils.isUndefinedOrNull(vm.dynamicId)){
                DynamicModel.getDynamicInfo({id:vm.dynamicId}).$promise.then(function(response){
                    if(response.stat == 'success'){
                        vm.dynamic = _.clone(response.dynamicInfo);
                    }
                })
            }
        });
    }

})();
